<!DOCTYPE HTML>
<html style="background-color:rgb(249,249,251)">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
    />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>ActivitiesDetails</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/pair.css" />
    <link rel="stylesheet" type="text/css" href="../../css/font-awesome.css" />

</head>

<style media="screen">
    .comment {
        position: fixed;
        width: 100%;
        height: 2rem;
        bottom: 0;
        background-color: #F4F5F6;
        margin: 0 auto;
    }

    .innercomment {
        position: relative;
        width: 95%;
        margin-top: 0.125rem;
        height: 1.75rem;
        margin-left: 0.5rem;
        border-radius: 1rem;
        background-color: #F4F5F6
    }

    .innerimg {
        position: absolute;
        width: 1.5rem;
        height: 1.5rem;
        left: 0.25rem;
        top: 0.125rem;
    }
    .innertext {
        position: absolute;
        width: 5rem;
        height: 1.5rem;
        left: 2rem;
        top: 0.125rem;
        line-height: 1.5rem;
    }
    .inner_icon {
        float: left;
        width: 45%;
        height: 1.75rem;
        margin-top: 0.125rem;
    }
    .commentarea {
        width: 100%;
        background-color: rgb(249, 249, 251);
        text-align: center;
    }

    .small_commentarea {
        width: 100%;
        height: 1.5rem;
        background-color: rgb(249, 249, 251);
        text-align: center;
    }

    .huismall_commentarea {
        width: 100%;
        height: 1.5rem;
        background-color: rgb(249, 249, 251);
        text-align: center;
        color: #ccc
    }

    .button {
        background-color: red;
        border-radius: 0.5rem;
    }
</style>

<body style="background-color:rgb(249,249,251)" id="all">
    <header id="head" class="aui-bar aui-bar-nav" style="background-color:white;position:fixed;z-index:2;height:2.3rem!important;padding-top:0.8rem;">
        <a class="aui-pull-left aui-btn" onclick="api.closeWin()">
            <i style="color:black" class="fa fa-chevron-left" aria-hidden="true"></i>
        </a>
        <div class="aui-title" style="color:black">活动详情</div>
        <a class="aui-pull-right">
            <span>
                <img src="../../image/321AC.png" style="padding-top:0.25rem;">
            </span>
        </a>
    </header>


    <div class="comment" id="botton">
        <div class="innercomment" @click="writecomment()">
            <div class="innerimg"><img src="../../image/edit.png" alt=""></div>
            <div class="innertext">
                <input type="text" style="width:5rem;height:1.5rem;line-height:1.5rem" placeholder="写个评论吧..." readonly="true">
            </div>
        </div>
    </div>
</body>

<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue1.0.js"></script>
<script type="text/javascript" src="../../script/util.js"></script>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript">
    var videoPlayer = null;
    var tab = $api.byId('all');
    var offset1 = $api.offset(all);
    var h1 = offset1.h;
    var w1 = offset1.w;
    //获取整个屏幕的高度
    var head = $api.byId('head');
    var offset2 = $api.offset(head);
    var h2 = offset2.h;
    //header的高
    var botton = $api.byId('botton');
    var offset3 = $api.offset(botton);
    var h3 = offset3.h;
    var opentype = 0;
    var photoBrowser = null;

    apiready = function () {
        var user = api.getPrefs({
            key: 'user',
            sync: true
        });
        var USER = JSON.parse(user);
        var index = api.pageParam["index"];
        var type = api.pageParam["type"];
        function open() {
            api.openFrame({
                name: 'acdetailframe',
                url: './acdetailframe.html',
                reload: true,
                rect: {
                    x: 0,
                    y: h2,
                    w: 'auto',
                    h: h1 - h3 - h2
                },
                pageParam: {
                    index: index,
                    type: type
                }
            });
        }
        vm = new Vue({
            el: "body",
            data: {
            },
            created: function () {
                var me = this;
                me.get();
                open();
            },
            methods: {
                get: function () {
                    var me = this;
                    var index = api.pageParam["index"];
                    var type = api.pageParam["type"];
                },
                //评论框
                writecomment: function () {
                    var me = this;
                    var dialogBox = api.require('dialogBox');
                    dialogBox.input({
                        keyboardType: 'default',
                        texts: {
                            title: '评论内容',
                            placeholder: '请输入您的评论',
                            leftBtnTitle: '取消',
                            rightBtnTitle: '提交评论'
                        },
                        styles: {
                            bg: '#F4F5F6',
                            corner: 6,
                            w: 300,
                            h: 210,
                            title: {
                                h: 40,
                                alignment: 'center',
                                size: 14,
                                color: '#000',
                                marginT: 20,
                            },
                            input: {
                                h: 60,
                                y: 30,
                                marginT: 15,
                                marginLeft: 10,
                                marginRight: 10,
                                textSize: 14,
                                textColor: '#000',
                                alignment: 'left'
                            },
                            dividingLine: {
                                width: 0.5,
                                color: '#696969'
                            },
                            left: {
                                bg: 'rgba(0,0,0,0)',
                                color: '#007FFF',
                                size: 12

                            },
                            right: {
                                bg: 'rgba(0,0,0,0)',
                                color: '#007FFF',
                                size: 12

                            }
                        }
                    }, function (ret) {
                        if (ret.eventType == 'left') {
                            var dialogBox = api.require('dialogBox');
                            dialogBox.close({
                                dialogName: 'input'
                            });
                        } else if (ret.eventType == 'right') {
                            api.ajax({
                                url: serverIp + "/friend/changecommentActivity.do",
                                method: 'post',
                                data: {
                                    values: {
                                        activityoid: me.activities.oid,
                                        userId: USER.userId,
                                        content: ret.text
                                    }

                                }
                            }, function (ret, err) {
                                if (ret) {
                                    alert("提交成功!");
                                    me.getcontent();
                                    open();
                                }
                            });

                            var dialogBox = api.require('dialogBox');
                            dialogBox.close({
                                dialogName: 'input'
                            });
                        }
                    });
                }
            }
        });
        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            if (opentype == 1) {
                api.execScript({
                    frameName:'acdetailframe',
                    script: 'closephotoBrowser();'
                });
                opentype = 0;
            } else {
                api.closeWin();
            }
        });
    }
    function changeOpentype() {
        opentype = 1;
    }
</script>

</html>